home *** CD-ROM | disk | FTP | other *** search
- /*============================================================
-
- N_Font sample program
-
- ============================================================*/
-
- #include "N_Library.h"
-
- void Int_Main_Loop(void);
- void Begin_Timer_Int(void* Int_Routine,short Tm_Counter);
- void Stop_Timer_Int(void);
-
- short Data_Rsrc = 0;
- WindowPtr window;
-
- short x = 640;
- char mes[] = "WELCOME TO N GAME LIBRARY! THANK YOU FOR DOWNLOADING/ THIS IS A FONT SAMPLE/@";
- Str255 putmes = "\pN";
- short mes_count = 0;
- short dot_count = 14;
- short style = 0;
-
- void main(void)
- {
- ToolboxInit();
- ColorCheck(); //change color depth
- HideMenuBar();
- HideCursor();
- window = GetNewWindow (128,nil,(WindowPtr)-1L );
- SetPort((GrafPtr)window);
- N_Window_Set(window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),640,480);
- Open_Resource_File(128,1,&Data_Rsrc);
- N_Sp_Make(640,16); //sprite offscreen make
- N_Cel_Make(65536); //set up cel plane
- N_Font_Init();
- N_Sprite_Set(130,11,12,16,1,13,4,0);
-
- N_Font_Set(0,0,0,0x80000000,0); //Font Set 0 normal overlap
- N_Font_Set(1,0x80000000+11,0,0x80000000+26+11,0x80000000+37+11); //Font Set 1
-
- N_Pict_Draw(128,0,0,(GrafPtr)Main_Window,true); //PICT 128
- Close_Resource_File(&Data_Rsrc);
- Begin_Timer_Int(Int_Main_Loop,17); //Timer Interrupt start
- do //check mouse button
- {
- }
- while (!Button());
- Stop_Timer_Int(); //Timer Interrupt stop
- ShowCursor();
- ShowMenuBar();
- ColorRevert();
- }
-
- void Int_Main_Loop(void)
- {
- char me;
- Rect sc_rect;
-
- if (dot_count == 0)
- {
- dot_count = 18;
- me = mes[mes_count];
- if (me == '@')
- {
- me = ' ' ;
- mes_count = 0;
- style++;
- if (style == 2) style = 0;
- }
- else
- {
- *(putmes+1) = me;
- N_Font_Put(putmes,626,430,14,1,0,30);
- mes_count++;
-
- if (style == 1)
- {
- SetRect(&sc_rect,622,442,640,430+16);
- ScrollRect(&sc_rect,-1,0,nil);
- SetRect(&sc_rect,622,438,640,430+16);
- ScrollRect(&sc_rect,-1,0,nil);
- SetRect(&sc_rect,622,434,640,430+16);
- ScrollRect(&sc_rect,-1,0,nil);
- }
- }
- }
- dot_count--;
- SetRect(&sc_rect,0,430,640,430+16);
- ScrollRect(&sc_rect,-1,0,nil);
- }
-
-
-
-
-